import itertools

persons=['Mike', 'Ellie', 'Rohan', 'Fatma']
colors=['红','紫','蓝','绿']
ranks=[1,2,3,4]
pos=-1
for c in itertools.permutations(colors):
    # print(c)
    for r in itertools.permutations(ranks):
        # print(r)
        if c[1]=='紫' and c[2]!='绿':
            if r[0]!=1 and r[0]!=4 and r[1]!=1 and r[1]!=4:
                ct=list(c)
                bluePos=ct.index('蓝')
                greenPos = ct.index('绿')
                purplePos = ct.index('紫')
                if r[bluePos]<r[3] and r[greenPos]<r[purplePos]:
                    for i in range(4):
                        if r[i]==2:
                            pos=i
                            break
        if pos>-1:
            break
    if pos > -1:
        break
# 输出第二名名字
print('第二名名字：'+persons[pos])
